package strategicPattern;

import lombok.Data;

/**
 * @author 帅小伙
 * @date 2022/1/2
 * @description
 */

public class MyDuck extends Duck{



    @Override
    public void quack() {
        if(quackSkill==null) {
            System.out.println("自由乱叫");
        }else{
            quackSkill.quack();
        }
    }

    @Override
    public void fly() {
        if(flySkill==null) {
            System.out.println("自由飞翔");
        }else{
            flySkill.fly();
        }
    }
}
